<?php
$this->widget('zii.widgets.grid.CGridView', array(
    'dataProvider' => $model->search(1),
    'filter' => $model,
    'emptyText'=> 'Không có banner nào',
    'columns' => array(
        array(
            'header'=>'No.',
            'value'=>'$this->grid->dataProvider->pagination->currentPage * $this->grid->dataProvider->pagination->pageSize + ($row+1)',
        ),              
        array(
            'name' => 'name',
            'type' => 'raw',
            'value'=>'CHtml::link(CHtml::encode($data->name),array("banner/update?id=".$data->id))'
        ),        
        
        array(
            'name' => 'file',
            'type' => 'raw',
            'value'=>function($data, $row){
                return "<a href='".Yii::app()->createUrl('admin/banner/update?id='.$data->id)."'><img width='200px' height='50px' src='".Yii::app()->createUrl($data->file)."'></a>";
            }
        ),
        
        array(
            'class' => 'CButtonColumn',
        ),
    ),
));
?>